package com.dyz.leetcode._07_hashSearch;

public class _389_findTheDifference {
    public char findTheDifference2(String s, String t) {
        int as = 0, at = 0;
        for (char c : s.toCharArray()) {as += c;}
        for (char c : t.toCharArray()) {at += c;}
        return (char)(at - as);
    }
    public char findTheDifference1(String s, String t) {
        int ret = 0;
        for (char c : s.toCharArray()) {ret ^= c;}
        for (char c : t.toCharArray()) {ret ^= c;}
        return (char)ret;
    }

}
